<html>
<head>
<title>The X Toolkit API</title>
<link href="doc.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
  google.load('visualization', '1', {packages: ['orgchart']});
</script>
<script type="text/javascript">

  // don't show internals by default
  var displayInternals = false;

  var toggleInternals = function() {
    
    // toggle the display variable
    displayInternals = !displayInternals;

    if (!document.styleSheets)
      return;
    var thecss = new Array();
    
    if (document.styleSheets[0].cssRules) thecss = document.styleSheets[0].cssRules;
    else thecss = document.styleSheets[0].rules;
    
    for (i = 0; i < thecss.length; i++) {
      
      if (thecss[i].selectorText.toLowerCase() == '.private') {
        
        if (displayInternals) {
          thecss[i].style.cssText += "display: block;";
          document.getElementById('togglBtn').innerHTML = 'Hide Internals'
        } else {
          thecss[i].style.cssText += "display: none;";
          document.getElementById('togglBtn').innerHTML = 'Show Internals'
        }
      
      } else if (thecss[i].selectorText.toLowerCase() == '.private_quicklink') {
        
        if (displayInternals) {
          thecss[i].style.cssText += "display: inline;";
        } else {
          thecss[i].style.cssText += "display: none;";
        }
        
      }
       
    }
    
  }
  
  function drawVisualization() {
    // Create and populate the data table.
    var data = google.visualization.arrayToDataTable([
      [{v:"goog.events.EventTarget",f:"<font color=green>goog.events.EventTarget</font>"},null,null],
["X.base","goog.events.EventTarget",null],
["X.triplets","X.base",null],

    ]);
  
    // Create and draw the visualization.
    new google.visualization.OrgChart(document.getElementById('diagram')).
        draw(data, {allowHtml: true, size:'small', color:'#f3f3f3'});
  }
  

  google.setOnLoadCallback(drawVisualization);  
  
</script>
</head>

<body>
	<h1>The X Toolkit API</h1>
	<div class="menu"><b>X</b><br><span class="menuitem"><a href="counter.html">X.counter</a></span><br><br><b>CORE</b><br><span class="menuitem"><a href="base.html">X.base</a></span><br><span class="menuitem"><a href="colortable.html">X.colortable</a></span><br><span class="menuitem"><a href="event.html">X.event</a></span><br><span class="menuitem"><a href="file.html">X.file</a></span><br><span class="menuitem"><a href="HoverEndEvent.html">X.HoverEndEvent</a></span><br><span class="menuitem"><a href="HoverEvent.html">X.HoverEvent</a></span><br><span class="menuitem"><a href="ModifiedEvent.html">X.ModifiedEvent</a></span><br><span class="menuitem"><a href="PanEvent.html">X.PanEvent</a></span><br><span class="menuitem"><a href="ProgressEvent.html">X.ProgressEvent</a></span><br><span class="menuitem"><a href="RenderEvent.html">X.RenderEvent</a></span><br><span class="menuitem"><a href="ResetViewEvent.html">X.ResetViewEvent</a></span><br><span class="menuitem"><a href="RotateEvent.html">X.RotateEvent</a></span><br><span class="menuitem"><a href="scalars.html">X.scalars</a></span><br><span class="menuitem"><a href="ScrollEvent.html">X.ScrollEvent</a></span><br><span class="menuitem"><a href="texture.html">X.texture</a></span><br><span class="menuitem"><a href="transform.html">X.transform</a></span><br><span class="menuitem"><a href="triplets.html">X.triplets</a></span><br><span class="menuitem"><a href="WindowLevelEvent.html">X.WindowLevelEvent</a></span><br><span class="menuitem"><a href="ZoomEvent.html">X.ZoomEvent</a></span><br><br><b>INJECTS</b><br><span class="menuitem"><a href="constructable.html">X.constructable</a></span><br><span class="menuitem"><a href="displayable.html">X.displayable</a></span><br><span class="menuitem"><a href="loadable.html">X.loadable</a></span><br><span class="menuitem"><a href="thresholdable.html">X.thresholdable</a></span><br><br><b>IO</b><br><span class="menuitem"><a href="interactor.html">X.interactor</a></span><br><span class="menuitem"><a href="interactor2D.html">X.interactor2D</a></span><br><span class="menuitem"><a href="interactor3D.html">X.interactor3D</a></span><br><span class="menuitem"><a href="loader.html">X.loader</a></span><br><span class="menuitem"><a href="parser.html">X.parser</a></span><br><span class="menuitem"><a href="parserCRV.html">X.parserCRV</a></span><br><span class="menuitem"><a href="parserDCM.html">X.parserDCM</a></span><br><span class="menuitem"><a href="parserFSM.html">X.parserFSM</a></span><br><span class="menuitem"><a href="parserIMAGE.html">X.parserIMAGE</a></span><br><span class="menuitem"><a href="parserLBL.html">X.parserLBL</a></span><br><span class="menuitem"><a href="parserLUT.html">X.parserLUT</a></span><br><span class="menuitem"><a href="parserMGZ.html">X.parserMGZ</a></span><br><span class="menuitem"><a href="parserNII.html">X.parserNII</a></span><br><span class="menuitem"><a href="parserNRRD.html">X.parserNRRD</a></span><br><span class="menuitem"><a href="parserOBJ.html">X.parserOBJ</a></span><br><span class="menuitem"><a href="parserSTL.html">X.parserSTL</a></span><br><span class="menuitem"><a href="parserTRK.html">X.parserTRK</a></span><br><span class="menuitem"><a href="parserVTK.html">X.parserVTK</a></span><br><br><b>MATH</b><br><span class="menuitem"><a href="array.html">X.array</a></span><br><span class="menuitem"><a href="matrix.html">X.matrix</a></span><br><span class="menuitem"><a href="vector.html">X.vector</a></span><br><br><b>OBJECTS</b><br><span class="menuitem"><a href="cube.html">X.cube</a></span><br><span class="menuitem"><a href="cylinder.html">X.cylinder</a></span><br><span class="menuitem"><a href="fibers.html">X.fibers</a></span><br><span class="menuitem"><a href="labelmap.html">X.labelmap</a></span><br><span class="menuitem"><a href="mesh.html">X.mesh</a></span><br><span class="menuitem"><a href="object.html">X.object</a></span><br><span class="menuitem"><a href="slice.html">X.slice</a></span><br><span class="menuitem"><a href="sphere.html">X.sphere</a></span><br><span class="menuitem"><a href="volume.html">X.volume</a></span><br><br><b>UI</b><br><span class="menuitem"><a href="caption.html">X.caption</a></span><br><span class="menuitem"><a href="progressbar.html">X.progressbar</a></span><br><br><b>VISUALIZATION</b><br><span class="menuitem"><a href="buffer.html">X.buffer</a></span><br><span class="menuitem"><a href="camera.html">X.camera</a></span><br><span class="menuitem"><a href="camera2D.html">X.camera2D</a></span><br><span class="menuitem"><a href="camera3D.html">X.camera3D</a></span><br><span class="menuitem"><a href="indexer.html">X.indexer</a></span><br><span class="menuitem"><a href="renderer.html">X.renderer</a></span><br><span class="menuitem"><a href="renderer2D.html">X.renderer2D</a></span><br><span class="menuitem"><a href="renderer3D.html">X.renderer3D</a></span><br><span class="menuitem"><a href="shaders.html">X.shaders</a></span><br><br></div>
	<div id="diagram"></div>
	<div class="content">
		<h2>X.triplets</h2>
		<div class="public" id="triplets">
<pre>/**
* Create an ordered container for triplets (3D tuples) with a
* fixed memory size.
*
* @param {!number} size The number of triplets to store. This is used to
*                       allocate memory: 4 bytes * size.
* @param {<a href="triplets.html">X.triplets</a>=} data Initial data as another <a href="triplets.html">X.triplets</a> container.
* @constructor
* @extends <a href="base.html">X.base</a>
*/</pre>
<span class="code">var t = new <span class="identifier">X.triplets()</span>;</span><br></div><div class="private" id="_centroid">
<pre>/**
* The centroid of the bounding box.
*
* @type {!Array}
* @protected
*/</pre>
<span class="code">t.<span class="identifier">_centroid</span> = $_CENTROID;</span><br></div><div class="private" id="_classname">
<pre>/**
* The className of this class.
*
* @type {string}
* @protected
*/</pre>
<span class="code">t.<span class="identifier">_classname</span> = $_CLASSNAME;</span><br></div><div class="private" id="_dataPointer">
<pre>/**
* The pointer to the current position in the float array.
*
* @type {!number}
* @protected
*/</pre>
<span class="code">t.<span class="identifier">_dataPointer</span> = $_DATAPOINTER;</span><br></div><div class="private" id="_dirty">
<pre>/**
* The 'dirty' flag of this object.
*
* @type {boolean}
* @protected
*/</pre>
<span class="code">t.<span class="identifier">_dirty</span> = $_DIRTY;</span><br></div><div class="private" id="_fresh">
<pre>/**
* This marks the triplets container as fresh meaning unused.
*
* @type {!boolean}
* @protected
*/</pre>
<span class="code">t.<span class="identifier">_fresh</span> = $_FRESH;</span><br></div><div class="private" id="_id">
<pre>/**
* The uniqueId of this instance. Each class instance in XTK has a uniqueId.
*
* @type {number}
* @protected
*/</pre>
<span class="code">t.<span class="identifier">_id</span> = $_ID;</span><br></div><div class="private" id="_maxA">
<pre>/**
* The maxA border of the bounding box.
*
* @type {number}
* @protected
*/</pre>
<span class="code">t.<span class="identifier">_maxA</span> = $_MAXA;</span><br></div><div class="private" id="_maxB">
<pre>/**
* The maxB border of the bounding box.
*
* @type {number}
* @protected
*/</pre>
<span class="code">t.<span class="identifier">_maxB</span> = $_MAXB;</span><br></div><div class="private" id="_maxC">
<pre>/**
* The maxC border of the bounding box.
*
* @type {number}
* @protected
*/</pre>
<span class="code">t.<span class="identifier">_maxC</span> = $_MAXC;</span><br></div><div class="private" id="_minA">
<pre>/**
* The minA border of the bounding box.
*
* @type {number}
* @protected
*/</pre>
<span class="code">t.<span class="identifier">_minA</span> = $_MINA;</span><br></div><div class="private" id="_minB">
<pre>/**
* The minB border of the bounding box.
*
* @type {number}
* @protected
*/</pre>
<span class="code">t.<span class="identifier">_minB</span> = $_MINB;</span><br></div><div class="private" id="_minC">
<pre>/**
* The minC border of the bounding box.
*
* @type {number}
* @protected
*/</pre>
<span class="code">t.<span class="identifier">_minC</span> = $_MINC;</span><br></div><div class="private" id="_triplets">
<pre>/**
* The one dimensional float array storing all triplets.
*
* @type {!Float32Array}
* @private
*/</pre>
<span class="code">t.<span class="identifier">_triplets</span> = $_TRIPLETS;</span><br></div><div class="public" id="classname_get">
<pre>/**
* Get the className of this object.
*
* @return {string} The className of this object.
* @public
*/</pre>
<span class="code">var _classname = t.<span class="identifier">classname</span>;</span><br></div><div class="public" id="count_get">
<pre>/**
* Get the number of triplets in this container.
*
* @return {!number} The number of triplets in this container.
* @public
*/</pre>
<span class="code">var _count = t.<span class="identifier">count</span>;</span><br></div><div class="public" id="id_get">
<pre>/**
* Get the id of this instance.
*
* @return {string} The className of this object.
* @public
*/</pre>
<span class="code">var _id = t.<span class="identifier">id</span>;</span><br></div><div class="public" id="length_get">
<pre>/**
* Get the length of this container. This equals the number of triplets
* multiplied by 3.
*
* @return {!number} The length of this container.
* @public
*/</pre>
<span class="code">var _length = t.<span class="identifier">length</span>;</span><br></div><div class="public" id="add">
<pre>/**
* Add a triplet to this container.
*
* @param {!number} a The first value of the triplet.
* @param {!number} b The second value of the triplet.
* @param {!number} c The third value of the triplet.
* @return {!number} The id of the added triplet.
* @throws {Error} An exception if the passed coordinates are invalid.
* @public
*/</pre>
<span class="code">var add = t.<span class="identifier">add</span>($A, $B, $C);</span><br></div><div class="public" id="clear">
<pre>/**
* Delete all triplets in this container.
*
* @public
*/</pre>
<span class="code">t.<span class="identifier">clear</span>();</span><br></div><div class="public" id="get">
<pre>/**
* Get the triplet with the given id.
*
* @param {!number} id The id of the requested triplet.
* @return {!Array} The triplet with the given id as a 1D Array with length 3.
* @public
*/</pre>
<span class="code">var get = t.<span class="identifier">get</span>($ID);</span><br></div><div class="public" id="remove">
<pre>/**
* Remove a given triplet from this container.
*
* @param {!number} id The id of the to be removed triplet.
* @public
*/</pre>
<span class="code">t.<span class="identifier">remove</span>($ID);</span><br></div><div class="public" id="resize">
<pre>/**
* Adjust the size of the internal array to match
* the real content.
*/</pre>
<span class="code">t.<span class="identifier">resize</span>();</span><br></div>
	</div>

  <div id="toolbox">
  <center><button id="togglBtn" type="button" onclick="javascript:toggleInternals();">Show Internals</button></center><br><br>
  <b>CONSTRUCTORS</b><br>
  <span class="public_quicklink"><a href="#triplets">X.triplets</a><br></span><br>
  <b>PROPERTIES</b><br>
  <span class="private_quicklink"><a href="#_centroid">_centroid</a><br></span><span class="private_quicklink"><a href="#_classname">_classname</a><br></span><span class="private_quicklink"><a href="#_dataPointer">_dataPointer</a><br></span><span class="private_quicklink"><a href="#_dirty">_dirty</a><br></span><span class="private_quicklink"><a href="#_fresh">_fresh</a><br></span><span class="private_quicklink"><a href="#_id">_id</a><br></span><span class="private_quicklink"><a href="#_maxA">_maxA</a><br></span><span class="private_quicklink"><a href="#_maxB">_maxB</a><br></span><span class="private_quicklink"><a href="#_maxC">_maxC</a><br></span><span class="private_quicklink"><a href="#_minA">_minA</a><br></span><span class="private_quicklink"><a href="#_minB">_minB</a><br></span><span class="private_quicklink"><a href="#_minC">_minC</a><br></span><span class="private_quicklink"><a href="#_triplets">_triplets</a><br></span><br>
  <b>GETTERS/SETTERS</b><br>
  <span class="public_quicklink"><a href="#classname_get">classname</a><br></span><span class="public_quicklink"><a href="#count_get">count</a><br></span><span class="public_quicklink"><a href="#id_get">id</a><br></span><span class="public_quicklink"><a href="#length_get">length</a><br></span><br>
  <b>FUNCTIONS</b><br>
  <span class="public_quicklink"><a href="#add">add</a><br></span><span class="public_quicklink"><a href="#clear">clear</a><br></span><span class="public_quicklink"><a href="#get">get</a><br></span><span class="public_quicklink"><a href="#remove">remove</a><br></span><span class="public_quicklink"><a href="#resize">resize</a><br></span><br>
  <b>STATIC</b><br>
  <br><br><br>
  <center><small><a href="https://github.com/xtk/X/blob/master/core/triplets.js" target="_blank">SOURCECODE</a><br></small></center>
  </div>	
	
	<br><br><br>
</body>

</html>